package cn.cdeden.knowledge.domain.vo;

import cn.cdeden.knowledge.domain.FilesDistributeTree;
import com.baomidou.mybatisplus.core.metadata.IPage;
//import io.swagger.annotations.ApiModelProperty;
import io.github.linpeilie.annotations.AutoMapper;
import io.github.linpeilie.annotations.AutoMappers;
import lombok.Data;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;

@Data
@AutoMappers({@AutoMapper(target = FilesDistributeTree.class)})
public class PersonalFilesTreeVo {

    /**
     * ID
     **/
    private Long id;

//    @ApiModelProperty(value = "排序字段")
    private Integer sort;

//    @ApiModelProperty(value = "树的头节点")
    private String topParentId;

//    @ApiModelProperty(value = "上级的编号")
    private String superiorsIds;

//    @ApiModelProperty(value = "父亲树")
    private String parentId;

//    @ApiModelProperty(value = "名称")
    private String realName;
//    @ApiModelProperty(value = "后缀名")
    private String suffix;

//    @ApiModelProperty(value = "上级路径")
    private String superiorsPath;

//    @ApiModelProperty(value = "路径")
    private String path;

//    @ApiModelProperty(value = "类型")
    private String type;

//    @ApiModelProperty(value = "儿子数据")
    private List<PersonalFilesTreeVo> children = new ArrayList<>();

//    @ApiModelProperty(value = "储存表id")
    private String storageId;
//    @ApiModelProperty(value = "版本")
    private String editionName;
//    @ApiModelProperty(value = "版本号")
    private String edition;


//    @ApiModelProperty(value = "储存服务器类型")
    private String storageType;
//    @ApiModelProperty(value = "文件大小")
    private Long size;

//    @ApiModelProperty(value = "收藏")
    private String collection;

//    @ApiModelProperty(value = "文档内容")
    private String docContent;

//    @ApiModelProperty(value = "创建编号")
    private String createId;

//    @ApiModelProperty(value = "创建者")
    private String createBy;

//    @ApiModelProperty(value = "创建日期")
    private Date createTime;

//    @ApiModelProperty(value = "更新编号")
    private String updateId;

//    @ApiModelProperty(value = "更新者")
    private String updateBy;

//    @ApiModelProperty(value = "更新时间")
    private Date updateTime;

//    @ApiModelProperty(value = "删除编号")
    private String deleteId;

//    @ApiModelProperty(value = "删除者")
    private String deleteBy;

//    @ApiModelProperty(value = "删除时间")
    private Date deleteTime;

//    @ApiModelProperty(value = "库的类型")
    private String libraryType = "personal";


//    @ApiModelProperty(value = "文件的MD5")
    private String fileMd5;


//    @ApiModelProperty(value = "备注")
    private String remarks;

//    @ApiModelProperty(value = "分页-总条数")
    private Long totalCount;

    private String expert;



//    @ApiModelProperty(value = "总条数")
    private Long pageCount;

    public  void setCount(IPage page){
        long total = page.getTotal();
        long pageSize = page.getSize();
        Long count = (total + pageSize -1) / pageSize;
        this.pageCount = count ;
        this.totalCount = total ;
    }
}
